home *** CD-ROM | disk | FTP | other *** search
/ Die Ultimative Software-P…i Collection 1996 & 1997 / Die Ultimative Software-Pakete CD-ROM fur Atari Collection 1996 & 1997.iso / i / internet / software / inetcust / pktdrv.h < prev   
Encoding:
C/C++ Source or Header  |  1991-10-08  |  1.4 KB  |  78 lines

  1. /* definitions for network packet driver accessory */
  2.  
  3. #ifndef _INET_PKT
  4. #define _INET_PKT
  5.  
  6. #define FALSE    0
  7. #define TRUE    !FALSE
  8.  
  9. #ifndef NULL
  10. #define NULL    ( (void*) 0L )
  11. #endif
  12.  
  13. typedef unsigned char u_char;
  14. typedef unsigned short u_short;
  15. typedef unsigned long u_long;
  16.  
  17.  
  18. #define PKTCOOKIE    0x5f504b54L            /* "_PKT" */
  19. #define MAXPROTOCOLS    4
  20.  
  21.  
  22. #define ET_IP    0x800
  23. #define ET_ARP    0x806
  24. #define ET_RARP    0x8035
  25.  
  26. #define NETRESET        0
  27. #define NETOPEN            1
  28. #define NETRELEASE        2
  29. #define NETSEND            3
  30. #define NETGETADR        4
  31. #define NETINFO            5
  32.  
  33. typedef char * (*pkt_hndl)(int,int,char *);
  34. typedef int (*demux_handler)(void);
  35.  
  36. typedef char HADDR[6];
  37.  
  38. int net_info(int, char *);
  39. int net_open(int, pkt_hndl);
  40. int net_release(int);
  41. int net_send(int, char *);
  42. int    net_getadr(int,HADDR);
  43. int net_reset(void);
  44. int net_demux(int,demux_handler);
  45. unsigned short chksum(register u_short*,u_short,u_short);
  46.  
  47. #define DEMUX    (demux_handler)0L
  48.  
  49. typedef struct
  50. {
  51.     HADDR        et_dest;
  52.     HADDR        et_src;
  53.     unsigned    et_type;
  54. } ETH;
  55.  
  56.  
  57. typedef struct
  58. {
  59.     ETH        pkt_head;
  60.     char    pkt_data[1518];
  61. } PACKET;
  62.  
  63.  
  64. /* error returnvalues from packetdriver */
  65.  
  66. #define EPROTAVAIL        -1
  67. #define EPROTUSED        -2
  68. #define EHANDLE            -3
  69. #define EPROTBUSY        -4
  70. #define EINIT            -5
  71. #define EPARAM            -6
  72. #define EPKTLEN            -7
  73. #define ECOLLISION        -8
  74. #define ETIMEOUT        -9
  75. #define ENOTINST        -10
  76.  
  77. #endif
  78.